// 与频道相关的请求
// 一、导入axios
import axios from '@/utils/request'

// 二、导出方法
// 2.1 获取用户频道
export const getChannels = () => {
  return axios({
    method: 'get',
    url: '/v1_0/user/channels',
  })
}

// 2.2 获取所有频道
export const getAllChannels = () => {
  return axios({
    method: 'get',
    url: '/v1_0/channels',
  })
}

// 2.3 批量修改用户频道列表（重置式）
export const putSetChannels = channels => {
  return axios({
    method: 'put',
    url: '/v1_0/user/channels',
    data: {
      channels,
    },
  })
}

// 2.4 删除指定用户频道
export const delChannel = channelId => {
  return axios({
    method: 'delete',
    url: `/v1_0/user/channels/${channelId}`,
  })
}
